package org.dyz.banana.platform.sample.eurakaclient.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SampleController {

	@GetMapping("/sample/getData")
	public String getData(@RequestParam("name")String name) {
		return name;
	}
	
	@GetMapping("/sample/getData/{name}")
	public String getData2(@PathVariable("name")String name) {
		return name;
	}
	
	@PostMapping("/sample/setData")
	public String setData(@RequestParam("name")String name) {
		System.out.println(name);
		return name;
	}
	
	@PostMapping("/sample/setData/{name}")
	public String setData2(@PathVariable("name")String name) {
		System.out.println(name);
		return name;
	}
	
	@PostMapping("/sample/setData2")
	public String setData3(@RequestBody String name) {
		System.out.println(name);
		return name;
	}
}
